From: Alexandru Ardelean Date: Tue, 24 Dec 2024 14:18:16 +0000 (+0200) Subject: python-installer: patch behavior for when script file exists X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=9a5f1dc8a1cc5cf9c9163994189e62653c11c649;p=feed%2Fpackages.git python-installer: patch behavior for when script file exists This seems to happen when re-triggering a build. The destination path is already there, so this exception gets raised. Another approach is to do 'make package//clean' and re-trigger the build. But that becomes annoying. Signed-off-by: Alexandru Ardelean --- diff --git a/lang/python/python-installer/Makefile b/lang/python/python-installer/Makefile index 898a74a3dd..2941a93697 100644 --- a/lang/python/python-installer/Makefile +++ b/lang/python/python-installer/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-installer PKG_VERSION:=0.7.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PYPI_NAME:=installer PKG_HASH:=a26d3e3116289bb08216e0d0f7d925fcef0b0194eedfa0c944bcaaa106c4b631 diff --git a/lang/python/python-installer/patches/001-don-t-raise-error-if-file-exists.patch b/lang/python/python-installer/patches/001-don-t-raise-error-if-file-exists.patch new file mode 100644 index 0000000000..f5ebb48c37 --- /dev/null +++ b/lang/python/python-installer/patches/001-don-t-raise-error-if-file-exists.patch @@ -0,0 +1,13 @@ +diff --git a/src/installer/destinations.py b/src/installer/destinations.py +index a3c1967..9f733c8 100644 +--- a/src/installer/destinations.py ++++ b/src/installer/destinations.py +@@ -164,7 +164,7 @@ class SchemeDictionaryDestination(WheelDestination): + target_path = self._path_with_destdir(scheme, path) + if os.path.exists(target_path): + message = f"File already exists: {target_path}" +- raise FileExistsError(message) ++ os.remove(target_path) + + parent_folder = os.path.dirname(target_path) + if not os.path.exists(parent_folder):